﻿<Application x:Class="Presentation.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Presentation"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/MetroStyles.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>

            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></BooleanToVisibilityConverter>

            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="Foreground"
                        Value="White"></Setter>
                <Setter Property="FontFamily"
                        Value="Segoe UI"></Setter>
                <Setter Property="FontSize"
                        Value="14"></Setter>
            </Style>

            <Style TargetType="{x:Type Button}">
                <Setter Property="Cursor"
                        Value="Hand"></Setter>
                <Setter Property="Width"
                        Value="150"></Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border x:Name="Bd"
                                    Padding="8,4,8,4"
                                    BorderBrush="White"
                                    BorderThickness="1">
                                <Border.Background>
                                    <SolidColorBrush Color="#62247B"
                                                     Opacity="0.5"></SolidColorBrush>
                                </Border.Background>
                                <TextBlock Text="{TemplateBinding Content}"
                                           FontFamily="Segoe UI"
                                           Foreground="White"
                                           FontSize="14"
                                           HorizontalAlignment="Center"></TextBlock>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver"
                                         Value="True"
                                         SourceName="Bd">
                                    <Trigger.Setters>
                                        <Setter Property="Background"
                                                TargetName="Bd">
                                            <Setter.Value>
                                                <SolidColorBrush Color="#723989"
                                                                 Opacity="0.8"></SolidColorBrush>
                                            </Setter.Value>
                                        </Setter>
                                    </Trigger.Setters>
                                </Trigger>
                                <Trigger Property="IsEnabled"
                                         Value="False"
                                         SourceName="Bd">
                                    <Trigger.Setters>
                                        <Setter Property="Background"
                                                TargetName="Bd">
                                            <Setter.Value>
                                                <SolidColorBrush Color="LightGray"
                                                                 Opacity="0.8"></SolidColorBrush>
                                            </Setter.Value>
                                        </Setter>
                                    </Trigger.Setters>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="CommonViewStyle"
                   TargetType="{x:Type UserControl}">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush>
                            <GradientStop Color="#38004D"
                                          Offset="0"></GradientStop>
                            <GradientStop Color="#52156A"
                                          Offset="1"></GradientStop>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="UserControl">
                            <Border Background="{TemplateBinding Background}">
                                <DockPanel LastChildFill="True">
                                    <Border DockPanel.Dock="Top"
                                            BorderBrush="White"
                                            BorderThickness="0,0,0,0"
                                            Margin="0,0,0,5"
                                            Padding="5">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition></ColumnDefinition>
                                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Text="{Binding Title}"
                                                    FontSize="35"
                                                    HorizontalAlignment="Left"></TextBlock>
                                            <StackPanel Grid.Column="1"
                                                        Orientation="Horizontal"
                                                        VerticalAlignment="Bottom"
                                                        Margin="0,0,0,3">
                                                <Image Width="30"
                                                       Height="30"
                                                       Source="Resources/user.png"></Image>
                                                <TextBlock Margin="5,0,0,0"
                                                           Text="{Binding CurrentUser}"
                                                           Foreground="White"
                                                           FontSize="15"
                                                           VerticalAlignment="Center"></TextBlock>
                                            </StackPanel>
                                        </Grid>
                                    </Border>
                                    <ContentPresenter Margin="20,0,0,0"></ContentPresenter>
                                </DockPanel>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>
    </Application.Resources>
</Application>
